package com.ydd.mapper;

import com.ydd.entity.Cate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hgz
 * @since 2023-05-30
 */
@Mapper
public interface CateMapper extends BaseMapper<Cate> {

    @Select("select * from ydd_cate")
    List<Cate> all();

    @Select("select count(*) from ydd_cate")
    Integer getCount();

    @Select("select catename from ydd_cate where id = #{cateid}")
    String findById(Integer cateid);

    List<Cate> page(String catename);

    @Select("select catename from ydd_cate where id= #{cateid}")
    String selectNameById(Integer cateid);

}
